package com.example.spindrift.Controllers;

import com.example.spindrift.dao.SysUserNotifMapper;
import com.example.spindrift.service.UserNotifService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/UserNotif")
public class UserNotifController {
    @Autowired
    UserNotifService userNotifService;

    /**
     * 阅读消息状态
     * @param notifId 通知ID
     * @param userId 用户ID
     * @return
     */
    @GetMapping("/readNotif")
    public Boolean readNotif(@RequestParam Integer notifId,@RequestParam Integer userId){
        return userNotifService.readNotif(notifId,userId) > 0;
    }
}
